import { post, get, del, put } from "./service"

export const login = data => {
    return post({
        url: '/login',
        data
    })
}

export const register = data => {
    return post({
        url: '/register',
        data
    })
}
export const resetPassword = data => {
    return post({
        url: '/resetpassword',
        data
    })
}

export const sendCaptcha = (email, use) => {
    return post({
        url: '/register/captcha',
        data: {
            email: email,
            use: use
        }
    })
}
export const getFeedback = data => {
    return get({
        url: '/feedback/admin/all',
        params: {
            isReplied: data.isReplied,
            pageSize: data.pageSize,
            pageNumber: data.pageNumber
        }
    })
}
export const getBiographicalNotes = data => {
    return get({
        url: '/biographical_notes/admin/all',
        params: {
            pageSize: data.pageSize,
            pageNumber: data.pageNumber
        }
    })
}
export const getPositions = data => {
    return get({
        url: '/position/admin/all',
        params: {
            pageSize: data.pageSize,
            pageNumber: data.pageNumber
        }
    })
}
export const getSeekerInfoList = data => {
    return get({
        url: '/seeker/admin/all',
        params: {
            pageSize: data.pageSize,
            pageNumber: data.pageNumber
        }
    })
}
export const getHrInfoList = data => {
    return get({
        url: '/hr/admin/all',
        params: {
            pageSize: data.pageSize,
            pageNumber: data.pageNumber
        }
    })
}

export const delFeedback = data => {
    return del({
        url: '/feedback/admin/delete',
        params: {
            id: data
        }
    })
}


export const replyFeedback = data => {
    return post({
        url: '/feedback/admin/reply',
        data
    })
}

export const lockSeeker = data => {
    return put({
        url: '/seeker/admin/lock',
        data: {
            id: data
        }
    })
}

export const unLockSeeker = data => {
    return put({
        url: '/seeker/admin/unLock',
        data: {
            id: data
        }
    })
}

export const lockHr = data => {
    return put({
        url: '/hr/admin/lock',
        data: {
            id: data
        }
    })
}

export const unLockHr = data => {
    return put({
        url: '/hr/admin/unLock',
        data: {
            id: data
        }
    })
}

export const authHr = data => {
    return put({
        url: '/admin/auth/hr',
        data: {
            id: data
        }
    })
}

export const unAuthHr = data => {
    return put({
        url: '/admin/unauth/hr',
        data: {
            id: data
        }
    })
}

export const authSeeker = data => {
    return put({
        url: '/admin/auth/seeker',
        data: {
            id: data
        }
    })
}

export const unAuthSeeker = data => {
    return put({
        url: '/admin/unauth/seeker',
        data: {
            id: data
        }
    })
}